<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 首页示例二</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link th:href="@{/css/bootstrap.min.css?v=3.3.7}" rel="stylesheet">
    <link th:href="@{/css/font-awesome.css?v=4.4.0}" rel="stylesheet">

    <!-- Morris -->
    <link th:href="@{/css/plugins/morris/morris-0.4.3.min.css}" rel="stylesheet">

    <!-- Gritter -->
    <link th:href="@{/js/plugins/gritter/jquery.gritter.css}" rel="stylesheet">

    <link th:href="@{/css/animate.css}" rel="stylesheet">
    <link th:href="@{/css/style.css?v=4.1.0}" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-success pull-right">月</span>
                        <h5>学生</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">23</h1>
                        <div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i>
                        </div>
                        <small>总学生人数</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-info pull-right">全年</span>
                        <h5>专业</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">4</h1>
                        <div class="stat-percent font-bold text-info">20% <i class="fa fa-level-up"></i>
                        </div>
                        <small>总专业数</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-primary pull-right">今天</span>
                        <h5>班级</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">3</h1>
                        <div class="stat-percent font-bold text-navy">44% <i class="fa fa-level-up"></i>
                        </div>
                        <small>总班级数</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-danger pull-right">最近一个月</span>
                        <h5>宿舍</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">3</h1>
                        <div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i>
                        </div>
                        <small>总宿舍数</small>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>各部门人数</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="flot-chart">
                                <div class="flot-chart-content" id="flot-dashboard-chart"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>每个专业的学生人数</h5>

                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="flot-chart">
                                <div class="flot-chart-content" id="circle"></div>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-title">
                    <h5>每个班级的学生人数</h5>
                     </div>
                    <div class="ibox-content">
                    <div class="row">
                        <div class="flot-chart">
                            <div class="flot-chart-content" id="circle2"></div>
                        </div>
                    </div>
                    </div>
                    <div class="ibox-title">
                        <h5>每个宿舍的学生人数</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="flot-chart">
                                <div class="flot-chart-content" id="circle3"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <div class="col-sm-8">

                <div class="row">
                    <div class="col-sm-6">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>每个年级的班级数</h5>
                                <div class="ibox-tools">
                                    <a class="collapse-link">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                    <a class="close-link">
                                        <i class="fa fa-times"></i>
                                    </a>
                                </div>
                            </div>
                            <div class="ibox-content">
                                <table class="table table-hover no-margins">
                                    <div class="row">
                                        <div class="flot-chart">
                                            <div class="flot-chart-content" id="pie1"></div>
                                        </div>
                                    </div>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>每个年级的宿舍数</h5>
                                <div class="ibox-tools">
                                    <a class="collapse-link">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                    <a class="close-link">
                                        <i class="fa fa-times"></i>
                                    </a>
                                </div>
                            </div>
                            <div class="ibox-content">
                                <div class="row">
                                    <div class="flot-chart">
                                        <div class="flot-chart-content" id="pie2"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>每个年级的专业数</h5>
                                <div class="ibox-tools">
                                    <a class="collapse-link">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                    <a class="close-link">
                                        <i class="fa fa-times"></i>
                                    </a>
                                </div>
                            </div>
                            <div class="ibox-content">

                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="row">
                                            <div class="flot-chart">
                                                <div class="flot-chart-content" id="flot-dashboard-chart2"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div id="world-map" style="height: 300px;"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>



        </div>

    </div>

    <!-- 全局js -->
    <script th:src="@{/js/jquery.min.js?v=2.1.4}"></script>
    <script th:src="@{/js/bootstrap.min.js?v=3.3.7}"></script>



    <!-- Flot -->
    <script th:src="@{/js/plugins/flot/jquery.flot.js}"></script>
    <script th:src="@{/js/plugins/flot/jquery.flot.tooltip.min.js}"></script>
    <script th:src="@{/js/plugins/flot/jquery.flot.spline.js}"></script>
    <script th:src="@{/js/plugins/flot/jquery.flot.resize.js}"></script>
    <script th:src="@{/js/plugins/flot/jquery.flot.pie.js}"></script>
    <script th:src="@{/js/plugins/flot/jquery.flot.symbol.js}"></script>

    <!-- Peity -->
    <script th:src="@{/js/plugins/peity/jquery.peity.min.js}"></script>
    <script th:src="@{/js/demo/peity-demo.js}"></script>

    <!-- 自定义js -->
    <script th:src="@{/js/content.js?v=1.0.0}"></script>


    <!-- jQuery UI -->
    <script th:src="@{/js/plugins/jquery-ui/jquery-ui.min.js}"></script>

    <!-- Jvectormap -->
    <script th:src="@{/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js}"></script>
    <script th:src="@{/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js}"></script>

    <!-- EayPIE -->
    <script th:src="@{/js/plugins/easypiechart/jquery.easypiechart.js}"></script>

    <!-- Sparkline -->
    <script th:src="@{/js/plugins/sparkline/jquery.sparkline.min.js}"></script>

    <!-- Sparkline demo data  -->
    <script th:src="@{/js/demo/sparkline-demo.js}"></script>

    <script th:src="@{/js/echarts.min.js}"></script>

    <script>
        $(document).ready(function () {
            let data = [];
            $.ajax({
                url: "/getData",
                type: "post",
                dataType: "json",
                async: false,
                success: function (d) {
                    data = d;
                }
            })


            var chartDom = document.getElementById('flot-dashboard-chart');
            var myChart = echarts.init(chartDom);
            var option;


            option = {
                grid: {
                    left: "5%",
                    right: "5%",
                    bottom: "2%",
                    top: "5%",
                    containLabel: true,
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                xAxis: {
                    type: 'category',
                    data: data.name
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: data.value,
                        type: 'line'
                    }
                ]
            };

            option && myChart.setOption(option);

            // let data2 = [];
            //     $.ajax({
            //         url: "/getData",
            //         type: "post",
            //         dataType: "json",
            //         async: false,
            //         success: function (d) {
            //             data = d;
            //         }
            //     })

            let data1 = [];
            $.ajax({
                url: "/student/getData1",
                type: "post",
                dataType: "json",
                async: false,
                success: function (d) {
                    data1 = d;
                }
            })
            var chartDom1 = document.getElementById('circle');
            var myChart1 = echarts.init(chartDom1);
            var option1;
            option1 = {
                grid: {
                    left: "5%",
                    right: "5%",
                    bottom: "2%",
                    top: "5%",
                    containLabel: true,
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                xAxis: {
                    type: 'category',
                    data: data1.name
                },

                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: data1.value,
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            option1 && myChart1.setOption(option1);

            let data2 = [];
            $.ajax({
                url: "/student/getData2",
                type: "post",
                dataType: "json",
                async: false,
                success: function (d) {
                    data2 = d;
                }
            })

            var chartDom2 = document.getElementById('circle2');
            var myChart2 = echarts.init(chartDom2);
            var option2;
            option2 = {
                grid: {
                    left: "5%",
                    right: "5%",
                    bottom: "2%",
                    top: "5%",
                    containLabel: true,
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                xAxis: {
                    type: 'category',
                    data: data2.name
                },

                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: data2.value,
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            option2 && myChart2.setOption(option2);

            let data3 = [];
            $.ajax({
                url: "/student/getData3",
                type: "post",
                dataType: "json",
                async: false,
                success: function (d) {
                    data3 = d;
                }
            })

            var chartDom3 = document.getElementById('circle3');
            var myChart3 = echarts.init(chartDom3);
            var option3;
            option3 = {
                grid: {
                    left: "5%",
                    right: "5%",
                    bottom: "2%",
                    top: "5%",
                    containLabel: true,
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                xAxis: {
                    type: 'category',
                    data: data3.name
                },

                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: data3.value,
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            option3 && myChart3.setOption(option3);

            let data4 = [];
            $.ajax({
                url: "/cla/getData",
                type: "post",
                dataType: "json",
                async: false,
                success: function (d) {
                    data4 = d;
                }
            })
            var chartDom4 = document.getElementById('pie1');
            var myChart4 = echarts.init(chartDom4);
            var option4;
            option4 = {
                series: [
                    {
                        type: 'pie',
                        data: [
                            {
                                value:10,
                                name: "大一"
                            },
                            {
                                value:5,
                                name: "大二"
                            },
                            {
                                value:15,
                                name: "大三"
                            },
                            {
                                value:4,
                                name: "大四"
                            },

                        ]

                    }
                ]
            };
            option4 && myChart4.setOption(option4);

            let data5 = [];
            $.ajax({
                url: "/hostel/getData",
                type: "post",
                dataType: "json",
                async: false,
                success: function (d) {
                    data5 = d;
                }
            })
            var chartDom5 = document.getElementById('pie2');
            var myChart5= echarts.init(chartDom5);
            var option5;
            option5 = {
                series: [
                    {
                        type: 'pie',
                        data: [
                            {
                                value:5,
                                name: "大一"
                            },
                            {
                                value:10,
                                name: "大二"
                            },
                            {
                                value:25,
                                name: "大三"
                            },
                            {
                                value:4,
                                name: "大四"
                            },

                        ]
                    }
                ]
            };
            option5 && myChart5.setOption(option5);

            let data6 = [];
            $.ajax({
                url: "/major/getData",
                type: "post",
                dataType: "json",
                async: false,
                success: function (d) {
                    data6 = d;
                }
            })
            var chartDom6 = document.getElementById('flot-dashboard-chart2');
            var myChart6 = echarts.init(chartDom6);
            var option6;


            option6 = {
                grid: {
                    left: "5%",
                    right: "5%",
                    bottom: "2%",
                    top: "5%",
                    containLabel: true,
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                xAxis: {
                    type: 'category',
                    data: data6.name
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: data6.value,
                        type: 'line'
                    }
                ]
            };

            option6 && myChart6.setOption(option6);

            var mapData = {
                "US": 298,
                "SA": 200,
                "DE": 220,
                "FR": 540,
                "CN": 120,
                "AU": 760,
                "BR": 550,
                "IN": 200,
                "GB": 120,
            };

            $('#world-map').vectorMap({
                map: 'world_mill_en',
                backgroundColor: "transparent",
                regionStyle: {
                    initial: {
                        fill: '#e4e4e4',
                        "fill-opacity": 0.9,
                        stroke: 'none',
                        "stroke-width": 0,
                        "stroke-opacity": 0
                    }
                },

                series: {
                    regions: [{
                        values: mapData,
                        scale: ["#1ab394", "#22d6b1"],
                        normalizeFunction: 'polynomial'
                    }]
                },
            });
        });
    </script>
</body>

</html>
